<template>
  <div class="myHire-page">
   <van-nav-bar title="房屋管理" @click-left="$router.back()" left-text="" left-arrow/>
   <div class="empty-container" v-if="list.length===0">
      <img src="http://liufusong.top:8080/img/not-found.png" alt="">
      <p>您还没有房源，<router-link class="Rent_link" to="">去发布房源</router-link>吧~</p>
   </div>
    <HouseList v-else
        v-for="item in list"
        :key="item.id"
        :item="item"
      ></HouseList>
  </div>
</template>

<script>
import { Toast } from 'vant'
import { houses } from '@/api/house'
export default {
  name: 'myHire-page',
  data () {
    return {
      list: []
    }
  },
  async created () {
    Toast.loading({
      message: '加载中...',
      forbidClick: true
    })
    const { body } = await houses()
    console.log(body)
    this.list = body
  },
  methods: {

  }
}
</script>

<style lang="less" scoped>
.empty-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    img{
      width: 150px;
      margin: 30px 0;
    }
    .Rent_link{
      color: #33be85;
    }
}
</style>
